import 'dart:convert';

import 'package:cassie_desktop/service/login_service.dart';
import 'package:cassie_desktop/service/menu_service.dart';
import 'package:cassie_desktop/theme.dart';
import 'package:fluent_ui/fluent_ui.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get_storage/get_storage.dart';

import 'controller/login_controller.dart';
import 'controller/system/menu_controller.dart';
import 'controller/system/user_controller.dart';
import 'global_state.dart';
const JsonDecoder decoder = JsonDecoder();
GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
Future<void> initContext()async {

  Get.put(GlobalState());
  Get.put(AppTheme());
  Get.put(MenuController());
  Get.put(UserController());
  await initStorage();
  initService();
}
Future<void> initStorage()async{
  await GetStorage.init("user");
  await GetStorage.init("params");
}
initService(){
  Get.put(LoginService());
  Get.put(MenuService());

}

cleanStorage()async{
  await GetStorage("user").erase();
  await GetStorage("params").erase();
}

